const readline = require("readline");
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});
let n, t;
let initArr = [];
rl.on("line", (line)=>{
    if( n === undefined) {
        n = Number(line.trim())
    } else if (t === undefined){
        t = Number(line.trim())
    } else {
        initArr = line.trim().split(" ").map(Number)
        console.log(getResult(n, t, initArr))

        // clear
        n = t = undefined
        initArr.length = 1
    }
})

function getResult(n, t, initArr) {
    let dp = new Array(n + 1).fill(Infinity)
    initArr.sort((a, b) => a - b)
    for (let i = 0; i < n; i++) {
        if(i === 0) {
            dp[0] = initArr[0]
            if(dp[0] > t) return "0 0"
        } else if ((i === 1)) {
            dp[1] = initArr[1]
        } else {
            dp[i] = Math.min(
                dp[i - 1] + dp[0] + initArr[i],
                dp[i - 2] + dp[0] + initArr[i] + dp[1] + dp[1]
            )
        }
        if(dp[i] > t) {
            return `${i} ${dp[i - 1]}`
        }
    }
    return `${n} ${dp[n - 1]}`

}
